package com.ugoodtech.mdcc.core.model.mapper;

import com.ugoodtech.mdcc.core.model.entity.Stations;
import com.ugoodtech.mdcc.core.model.entity.StationsExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StationsMapper {
    @SelectProvider(type=StationsSqlProvider.class, method="countByExample")
    int countByExample(StationsExample example);

    @DeleteProvider(type=StationsSqlProvider.class, method="deleteByExample")
    int deleteByExample(StationsExample example);

    @Delete({
        "delete from stations",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into stations (id, creation_time, ",
        "deleted, enabled, update_time, ",
        "address, category, ",
        "check_station, city, ",
        "colorReportId, contact, ",
        "district, name, ",
        "province, station_num, ",
        "user_id, customer_stat, ",
        "customer_type, product_position, ",
        "paint_brand, is_paint, ",
        "is_other_brand, report_finished, ",
        "brand)",
        "values (#{id,jdbcType=BIGINT}, #{creationTime,jdbcType=TIMESTAMP}, ",
        "#{deleted,jdbcType=BIT}, #{enabled,jdbcType=BIT}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{address,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, ",
        "#{checkStation,jdbcType=BIT}, #{city,jdbcType=VARCHAR}, ",
        "#{colorreportid,jdbcType=BIGINT}, #{contact,jdbcType=VARCHAR}, ",
        "#{district,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{province,jdbcType=VARCHAR}, #{stationNum,jdbcType=VARCHAR}, ",
        "#{userId,jdbcType=BIGINT}, #{customerStat,jdbcType=BIGINT}, ",
        "#{customerType,jdbcType=BIGINT}, #{productPosition,jdbcType=VARCHAR}, ",
        "#{paintBrand,jdbcType=VARCHAR}, #{isPaint,jdbcType=INTEGER}, ",
        "#{isOtherBrand,jdbcType=BIT}, #{reportFinished,jdbcType=INTEGER}, ",
        "#{brand,jdbcType=LONGVARCHAR})"
    })
    int insert(Stations record);

    @InsertProvider(type=StationsSqlProvider.class, method="insertSelective")
    int insertSelective(Stations record);

    @SelectProvider(type=StationsSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="category", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="check_station", property="checkStation", jdbcType=JdbcType.BIT),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="colorReportId", property="colorreportid", jdbcType=JdbcType.BIGINT),
        @Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="station_num", property="stationNum", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_stat", property="customerStat", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_type", property="customerType", jdbcType=JdbcType.BIGINT),
        @Result(column="product_position", property="productPosition", jdbcType=JdbcType.VARCHAR),
        @Result(column="paint_brand", property="paintBrand", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_paint", property="isPaint", jdbcType=JdbcType.INTEGER),
        @Result(column="is_other_brand", property="isOtherBrand", jdbcType=JdbcType.BIT),
        @Result(column="report_finished", property="reportFinished", jdbcType=JdbcType.INTEGER),
        @Result(column="brand", property="brand", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Stations> selectByExampleWithBLOBs(StationsExample example);

    @SelectProvider(type=StationsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="category", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="check_station", property="checkStation", jdbcType=JdbcType.BIT),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="colorReportId", property="colorreportid", jdbcType=JdbcType.BIGINT),
        @Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="station_num", property="stationNum", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_stat", property="customerStat", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_type", property="customerType", jdbcType=JdbcType.BIGINT),
        @Result(column="product_position", property="productPosition", jdbcType=JdbcType.VARCHAR),
        @Result(column="paint_brand", property="paintBrand", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_paint", property="isPaint", jdbcType=JdbcType.INTEGER),
        @Result(column="is_other_brand", property="isOtherBrand", jdbcType=JdbcType.BIT),
        @Result(column="report_finished", property="reportFinished", jdbcType=JdbcType.INTEGER)
    })
    List<Stations> selectByExample(StationsExample example);

    @Select({
        "select",
        "id, creation_time, deleted, enabled, update_time, address, category, check_station, ",
        "city, colorReportId, contact, district, name, province, station_num, user_id, ",
        "customer_stat, customer_type, product_position, paint_brand, is_paint, is_other_brand, ",
        "report_finished, brand",
        "from stations",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="category", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="check_station", property="checkStation", jdbcType=JdbcType.BIT),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="colorReportId", property="colorreportid", jdbcType=JdbcType.BIGINT),
        @Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="station_num", property="stationNum", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_stat", property="customerStat", jdbcType=JdbcType.BIGINT),
        @Result(column="customer_type", property="customerType", jdbcType=JdbcType.BIGINT),
        @Result(column="product_position", property="productPosition", jdbcType=JdbcType.VARCHAR),
        @Result(column="paint_brand", property="paintBrand", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_paint", property="isPaint", jdbcType=JdbcType.INTEGER),
        @Result(column="is_other_brand", property="isOtherBrand", jdbcType=JdbcType.BIT),
        @Result(column="report_finished", property="reportFinished", jdbcType=JdbcType.INTEGER),
        @Result(column="brand", property="brand", jdbcType=JdbcType.LONGVARCHAR)
    })
    Stations selectByPrimaryKey(Long id);

    @UpdateProvider(type=StationsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Stations record, @Param("example") StationsExample example);

    @UpdateProvider(type=StationsSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Stations record, @Param("example") StationsExample example);

    @UpdateProvider(type=StationsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Stations record, @Param("example") StationsExample example);

    @UpdateProvider(type=StationsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Stations record);

    @Update({
        "update stations",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "address = #{address,jdbcType=VARCHAR},",
          "category = #{category,jdbcType=VARCHAR},",
          "check_station = #{checkStation,jdbcType=BIT},",
          "city = #{city,jdbcType=VARCHAR},",
          "colorReportId = #{colorreportid,jdbcType=BIGINT},",
          "contact = #{contact,jdbcType=VARCHAR},",
          "district = #{district,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "province = #{province,jdbcType=VARCHAR},",
          "station_num = #{stationNum,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "customer_stat = #{customerStat,jdbcType=BIGINT},",
          "customer_type = #{customerType,jdbcType=BIGINT},",
          "product_position = #{productPosition,jdbcType=VARCHAR},",
          "paint_brand = #{paintBrand,jdbcType=VARCHAR},",
          "is_paint = #{isPaint,jdbcType=INTEGER},",
          "is_other_brand = #{isOtherBrand,jdbcType=BIT},",
          "report_finished = #{reportFinished,jdbcType=INTEGER},",
          "brand = #{brand,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKeyWithBLOBs(Stations record);

    @Update({
        "update stations",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "address = #{address,jdbcType=VARCHAR},",
          "category = #{category,jdbcType=VARCHAR},",
          "check_station = #{checkStation,jdbcType=BIT},",
          "city = #{city,jdbcType=VARCHAR},",
          "colorReportId = #{colorreportid,jdbcType=BIGINT},",
          "contact = #{contact,jdbcType=VARCHAR},",
          "district = #{district,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "province = #{province,jdbcType=VARCHAR},",
          "station_num = #{stationNum,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "customer_stat = #{customerStat,jdbcType=BIGINT},",
          "customer_type = #{customerType,jdbcType=BIGINT},",
          "product_position = #{productPosition,jdbcType=VARCHAR},",
          "paint_brand = #{paintBrand,jdbcType=VARCHAR},",
          "is_paint = #{isPaint,jdbcType=INTEGER},",
          "is_other_brand = #{isOtherBrand,jdbcType=BIT},",
          "report_finished = #{reportFinished,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Stations record);
}